This function converts a date of data type DTL into a character string of data type STRING in international format (ISO) (YYYY MM DD…).
| LGF_DTLToString_ISO (FC) | ||||||||
|---|---|---|---|---|---|---|---|---|
| DTL | date | Ret_Val | String | |||||
| Char | separator | |||||||
| Char | separatorDateAndTime | |||||||
| Identifier | Data type | Description |
|---|---|---|
| date | DTL | Date to convert as DTL tag |
| separator | Char | Separator between the components of the output date. |
| separatorDateAndTime | Char | Separator between the components date and time. |
| Identifier | Data type | Description |
|---|---|---|
| Ret_Val | String | Output string in accordance with the international format (ISO 8601). Example: `2019-01-22 14:06:51.524621000` |
The block reads a date of data type DTL and converts the individual components of the date (year, month, day, hour…) into a character string and outputs it in international format (ISO 8601). The separator between the components of the date is variable.

At the input parameter separator, you specify the separator between the components of the date, at seperatorDateAndTime you specify the separator between the date and the time.
separator = - - outString = 2016-03-16… (default)
separator = / - outString = 2016/03/16…
separatorDateAndTime = - outString = 2016-03-16 12:45… (default)
separatorDateAndTime = T - outString = 2016/03/16T12:45…
| Version & Date | Change description | |
|---|---|---|
| 1.0.0 | Siemens Industry Online Support | |
| 15.06.2016 | First released version | |
| 1.0.1 | Siemens Industry Online Support | |
| 02.01.2017 | Upgrade: TIA Portal V14 Update 1 | |
| 1.0.2 | Siemens Industry Online Support | |
| 17.08.2018 | Upgrade: TIA V15 Update 2 | |
| 1.0.3 | Siemens Industry Online Support | |
| 23.11.2018 | Upgrade: TIA V15.1 | |
| 1.0.4 | Simatic Systems Support | |
| 17.07.2019 | Bugfix - nanosecond precision and '0' filling | |
| 1.0.5 | Simatic Systems Support | |
| 18.07.2019 | Renamed from "LGF_DTLtoString" to "LGF_DTLToString_ISO" Split into two blocks, removed "format" input | |
| 3.0.0 | Simatic Systems Support | |
| 23.04.2020 | Set version to V3.0.0 Harmonize the version of the whole library | |
| 3.0.1 | Simatic Systems Support | |
| 23.02.2021 | Insert documentation | |
| 3.1.0 | Simatic Systems Support | |
| 25.07.2025 | Insert parameter for separator between Data and time Assign default value '-' for separator parameter | |
| 3.1.1 | Simatic Systems Support | |
| 09.10.2025 | Spelling errors | |